<?php
/**
 * This file is form http://findcat.cn
 *
 * @link     https://findcat.cn
 * @email    1476982312@qq.com
 */
namespace App\Http\Controllers\Home;

use App\Models\FriendlyLink;
use App\Http\Controllers\Controller;

class FriendlyLinkController extends Controller
{
    /**
     * 获取友情链接列表.
     *
     * @return \Illuminate\Database\Eloquent\Builder[]|\Illuminate\Database\Eloquent\Collection
     */
    public function index()
    {
        $friendlyLinks = FriendlyLink::query()
            ->where('status', 1)
            ->orderBy('sort', 'asc')
            ->get();

        $data = [
            'friendlyLinks' => $friendlyLinks,
        ];

        return view('home.links', $data);
    }
}
